﻿#region << 版 本 注 释 >>
/*----------------------------------------------------------------
 * 版权所有 (c) 2022 北京超维景生物科技有限公司 保留所有权利。
 * CLR版本：4.0.30319.42000
 * 文件名：Kernel
 * 
 * 创建者：huangyang
 * 电子邮箱：huangyang@tvscope.cn
 * 创建时间：2023/2/15 14:12:57
 * 版本：V1.0.0
 * 描述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：
 *
 * 版本：V1.0.1
 *----------------------------------------------------------------*/
#endregion << 版 本 注 释 >>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ImageK.Process;

namespace ImageK.Plugin.Filter
{
    public abstract class BasePlugInFilter:PlugInFilter
    {
        public abstract int setup(string arg, ImagePlus imp);

        public abstract void run(ImageProcessor ip);

        /** Set this flag if the filter handles 8-bit grayscale images. */
        public const int DOES_8G = 1;
        /** Set this flag if the filter handles 8-bit indexed color images. */
        public const int DOES_8C = 2;
        /** Set this flag if the filter handles 16-bit images. */
        public const int DOES_16 = 4;
        /** Set this flag if the filter handles float images. */
        public const int DOES_32 = 8;
        /** Set this flag if the filter handles RGB images. */
        public const int DOES_RGB = 16;
        /** Set this flag if the filter handles all types of images. */
        public const int DOES_ALL = DOES_8G + DOES_8C + DOES_16 + DOES_32 + DOES_RGB;

        /** Set this flag if the filter wants its run() method to be
        called for all the slices in a stack. */
        public const int DOES_STACKS = 32;
        /** Set this flag if the filter wants ImageJ, for non-rectangular
            ROIs, to restore that part of the image that's inside the bounding
            rectangle but outside of the ROI. */
        public const int SUPPORTS_MASKING = 64;
        /** Set this flag if the filter makes no changes to the pixel data and does not require undo. */
        public const int NO_CHANGES = 128;
        /** Set this flag if the filter does not require undo. */
        public const int NO_UNDO = 256;
        /** Set this flag if the filter does not require that an image be open. */
        public const int NO_IMAGE_REQUIRED = 512;
        /** Set this flag if the filter requires an ROI. */
        public const int ROI_REQUIRED = 1024;
        /** Set this flag if the filter requires a stack. */
        public const int STACK_REQUIRED = 2048;
        /** Set this flag if the filter does not want its run method called. */
        public const int DONE = 4096;
        /** Set this flag to have the ImageProcessor that is passed to the run() method 
            converted  to a FloatProcessor. With  RGB images, the run() method is  
            called three times, once for each channel. */
        public const int CONVERT_TO_FLOAT = 8192;
        /** Set this flag if the filter requires a snapshot (copy of the pixels array). */
        public const int SNAPSHOT = 16384;
        /** Set this flag if the filter wants to be called with arg = "dialog" after
            being invocated the first time */
        /** Set this flag if the slices of a stack may be processed in parallel threads */
        public const int PARALLELIZE_STACKS = 32768;
        /** Set this flag if the setup method of the filter should be called again after
         *  the calls to the run(ip) have finished. The argument <code>arg</code> of setup
         *  will be "final" in that case. */
        public const int FINAL_PROCESSING = 65536;
        /** Set this flag to keep the invisible binary threshold from being reset. */
        public const int KEEP_THRESHOLD = 131072;
        /** Set this flag if images may be processed in parallel threads. Overrides PARALLELIZE_STACKS.
            The plugin's run() method is called in parallel threads, with the ROI rectangle of the
            ImageProcessor set according to the area that should be processed. Use the
            Edit/Options/Memory & Threads command to view or set the thread count. */
        public const int PARALLELIZE_IMAGES = 262144;
        /** Set this flag to prevent Undo from being reset when processing a stack. */
        public const int NO_UNDO_RESET = 524288;

        // flags 0x01000000 and above are reserved for ExtendedPlugInFilter
    }
}
